from django.urls import path, include
from rest_framework.routers import DefaultRouter
from . import views

# API路由器
router = DefaultRouter()
router.register(r'processor', views.ExcelProcessorViewSet, basename='excel-processor')

app_name = 'excel_processor'

urlpatterns = [
    # Web视图
    path('status/', views.processor_status, name='status'),
    
    # AJAX接口
    path('ajax/process/', views.ajax_process_files, name='ajax_process_files'),
    path('ajax/progress/', views.ajax_task_progress, name='ajax_task_progress'),
    
    # 文件下载
    path('download/<int:task_id>/', views.download_result_files, name='download_result_files'),
    
    # API路由
    path('api/', include(router.urls)),
]